<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<table width="50%" align="center" border="1">
		<form action="${pageContext.request.contextPath }/stuList" method="get">
			<tr>
				<th align="center" colspan="4">
				姓名：<input type="text" name="stuName"/>&nbsp;
				成绩：<input type="text" name="stuMarks"/>&nbsp;
				出生日期：<input type="text" name="stuBirth"/>&nbsp;
				<input type="submit" value="查询"/>&nbsp;
				<input type="button" value="新增" onclick="window.location.href='${pageContext.request.contextPath }/toAdd'"/>&nbsp;
				<input type="button" value="批量删除" onclick="document.getElementById('stuListForm').submit()">&nbsp;
				</th>
			</tr>
		</form>
		<tr>
			<th></th>
			<th>学号</th>
			<th>姓名</th>
			<th>出生日期</th>
			<th>成绩</th>
		</tr>
		<form id="stuListForm" action="${pageContext.request.contextPath}/delBatch">
			<c:forEach items="${stuList }" var="stu">
				<tr align="center">
					<td>
						<input type="checkbox" name="stuNos" value="${stu.stuNo }"/>
					</td>
					<td>${stu.stuNo }</td>
					<td>${stu.stuName }</td>
					<td><fmt:formatDate value="${stu.stuBirth }" pattern="yyyy年MM月dd日"/></td>
					<td>${stu.stuMarks }</td>
				</tr>
			</c:forEach>
		</form>
	</table>
</body>
</html>